
function GlobalZone(marker, info) { 
    this.id=info.id;
    this.marker = marker;
    this.info = info;
}

// Add methods like this.  All Person objects will be able to invoke this
GlobalZone.prototype.setMap = function(map) { 
    this.marker.setMap(map);
};

GlobalZone.prototype.clearMap = function() { 
    this.marker.setMap(null);
};

GlobalZone.prototype.addListener = function(event, call) { 
    google.maps.event.addListener(this.marker, event, call);
};
  
GlobalZone.prototype.save = function(operator, onSuccess) { 
    /*
    var json = JSON.stringify(this.getJson()); 
    var url;
    if (this.info.id){
        console.log('Updating Restitution Zone Id= :' + this.info.id+' Json:'+json);
        url = "rest/restitutionZone/update";
    } else {
        console.log('Creating Restitution Zone :' + json);
        url = "rest/restitutionZone/create";
        
    }
    $.ajax
            ({
                type: "POST",
                url: url,
                dataType: 'json',
                data: {
                    id:this.info.id,
                    data: json ,
                    actif:this.info.actif,
                    reference: this.info.reference,                    
                    operator: operator
                },
                success: onSuccess
            }) 
            */
};

GlobalZone.prototype.getJson = function() { 
    var pos = this.marker.position; 
    return {
        'lat': nThObject(pos, 1),
        'lng': nThObject(pos, 2)
    };
};
 
 
 